x=0:10;
y=sin(x);
xi=0:.15:10;
yi1=interp1(x,y,xi,'nearest');
yi2=interp1(x,y,xi,'pchip');
yi3=interp1(x,y,xi,'spline');
subplot(2,2,1)
plot(xi,yi1,xi,yi1,'r.');
subplot(2,2,2)
plot(xi,yi2,xi,yi2,'r.');
subplot(2,2,3)
plot(xi,yi3,xi,yi3,'r.');
